package com.lottery.im.module.service.ui;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import com.lottery.im.R;
import com.lottery.im.api.result.entity.integral.ExchangeResult;
import com.lottery.im.base.BaseSwipeFragment;

/**
 * 作者：cyy
 * 时间：2018/9/20。
 */
@SuppressLint("ValidFragment") public class ExchangeResultFragment extends BaseSwipeFragment {
  @BindView(R.id.tv_title) TextView tvTitle;
  Unbinder unbinder;

  private ExchangeResult mExchangeResult;

  @SuppressLint("ValidFragment") public ExchangeResultFragment(
      ExchangeResult exchangeResult) {
    mExchangeResult = exchangeResult;
  }

  @Override protected int getLayoutResId() {
    return R.layout.fragment_exchange_result;
  }

  @Override protected void initPresenter() {

  }

  @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    // TODO: inflate a fragment view
    View rootView = super.onCreateView(inflater, container, savedInstanceState);
    unbinder = ButterKnife.bind(this, rootView);

    tvTitle.setText("兑换结果");
    getChildFragmentManager().beginTransaction()
        .replace(R.id.frameLayout,new ExchangeResultSubFragment(mExchangeResult)).commit();
    return rootView;
  }

  @Override public void onDestroyView() {
    super.onDestroyView();
    unbinder.unbind();
  }

  @OnClick(R.id.iv_back) public void onViewClicked() {
    popBackStack();
  }
}
